{% extends 'Base/main.content.lists.div.html.twig' %}{% import 'Base/list_item.twig' as listItem %}
{#{% block addBtn %}{% endblock %}#}
{% block delBtn %}{% endblock %}
{% block options %}
    <div class="menu-list">
        {#{{ dump(tools) }}#}
        {% for key , classes in tools %}
            {% set default = "请选择分类" %}
            {% set classes = classes %}
            <div class="layui-inline">
                <select name="cond[{{ key }}]" onchange="javascript:__doPostBack('searchCond','')" >
                    <option value="" {{app.request.get("cond")[key] is defined and app.request.get("cond")[key] == "" ? ' selected="selected"' : "" }} >{{ default }}</option>
                    {% for class in classes %}
                        <option
                                value="{{ class.id }}"
                                {{app.request.get("cond")[key] is defined and  app.request.get("cond")[key] == class.id ? ' selected="selected"' : "" }}
                                >{{ class.name }}</option>
                    {% endfor %}
                </select>
            </div>
        {% endfor %}
    </div>
{% endblock %}
{% block tableHead %}
    <tr>
        <th width="3%">选择</th>
        <th align="left" width="6%">#</th>
        <th align="left" width="10%">名称</th>
        <th align="left" width="10%">C</th>
        <th align="left" width="15%">K</th>
        <th align="left" width="15%">V</th>
        <th align="left">说明</th>
        <th align="right" width="10%"> </th>
    </tr>
{% endblock %}
{% block tableList %}
    {#{{ dump(lists) }}#}
    {% for Entity in lists %}
        <tr>
            <td align="center">
                <span class="checkall" style="vertical-align:middle;">
                    <input lay-skin="primary" type="checkbox" name="ids[]" value="{{ Entity.Rules_id }}"/>
                </span>
            </td>

            <td align="left">{{ Entity.Rules_id }}</td>
            <td align="left">{{ Entity.Rules_name }}</td>
            <td align="left">{{ Entity.RulesCategory_name }}</td>
            <td align="left">
                <input
                        id="val_k_{{ Entity.Rules_id }}"
                        type="text" value="{{ Entity.Rules_k }}"
                        class="layui-input"
                        onblur="__doPostBack('setAttr','id={{ Entity.Rules_id }}&k='+ $('#val_k_{{ Entity.Rules_id }}').val())"
                >
            </td>
            <td align="left">
                <input
                        id="val_v_{{ Entity.Rules_id }}"
                        type="text" value="{{ Entity.Rules_v }}"
                        class="layui-input"
                        onblur="__doPostBack('setAttr','id={{ Entity.Rules_id }}&v='+ $('#val_v_{{ Entity.Rules_id }}').val())"
                >
            </td>
            <td align="left">{{ Entity.Rules_tips }}</td>
            <td align="right">
                <a href="{{ path("RulesPreEdit",{'id':Entity.Rules_id}) }}" class="layui-btn layui-btn-normal layui-btn-sm"><span class="fa fa-edit c13"></span></a>
            </td>
        </tr>
    {% endfor %}
{% endblock %}
{% block script %}
{% endblock %}

